package cn.south.campus.admin.campus.controller;

import cn.south.campus.admin.campus.model.req.AuditReq;
import cn.south.campus.admin.campus.model.req.WithdrawalAuditReq;
import cn.south.campus.admin.campus.model.vo.WithdrawalAuditVo;
import cn.south.campus.admin.campus.service.WithdrawalAuditService;
import cn.south.campus.common.model.bo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 提现记录
 * </p>
 *
 * @author chow
 * @since 2024/11/14 15:09
 */
@RestController
@RequestMapping("/campus/withdrawal/audit")
@AllArgsConstructor
public class WithdrawalAuditController {

    private final WithdrawalAuditService withdrawalAuditService;

    @GetMapping("/page")
    public Result<IPage<WithdrawalAuditVo>> page(WithdrawalAuditReq req) {
        IPage<WithdrawalAuditVo> iPage = withdrawalAuditService.pageQuery(req);
        return Result.success(iPage);
    }

    @PutMapping()
    public Result<String> audit(@RequestBody AuditReq req) {
        withdrawalAuditService.audit(req);
        return Result.success("审核成功");
    }
}
